package com.jimikongjian.service.dao.impl;

import com.jimikongjian.dao.IAlbum;
import com.jimikongjian.dao.IParameter;
import com.jimikongjian.models.Album;
import com.jimikongjian.models.Parameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by fuxiuyang on 17/2/23.
 */
@Service("iParameterImpl")
public class IParameterImpl implements IParameter {

    @Autowired
//    @Qualifier("albumMapper")
    private IParameter iParameter;

    /**
     * 通过id获取权重信息
     *
     * @param id
     * @return List<Album>
     */
    @Override
    public List<Parameter> getById(int id) {
        if (id > 0){
            return iParameter.getById(id);
        }
        return null;
    }

    /**
     * 通过id获取权重信息
     *
     * @param id
     * @return Album
     */
    @Override
    public Parameter getParameterById(int id) {
        List<Parameter> list = getById(id);
        if (list != null && list.size() > 0){
            return list.get(0);
        }
        return null;
    }
}
